Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ghc::filesystem::last_write_time() setter on iOS/tvOS/watchOS #153

Merged
merged 1 commit into from
Feb 17, 2023

Conversation

kkaefer
Copy link
Contributor

@kkaefer kkaefer commented Jul 27, 2022

The previous implementation tried to detect old deployment targets for macOS that doesn't have the newer utimensat call. Unfortunately, it would just detect macOS, and didn't check for the corresponding iOS/tvOS/watchOS version numbers. On those platforms, last_write_time() was effectively a no-op, failing silently and not modifying the mtime of the file.

This patch adds detection for these platforms. It also removes the special casing when newer versions of macOS/iOS/tvOS/watchOS are used as the deployment targets, and instead folds it into the default POSIX branch.

The previous implementation tried to detect old deployment targets for macOS that doesn't have the newer `utimensat` call. Unfortunately, it would just detect macOS, and didn't check for the corresponding iOS/tvOS/watchOS version numbers. On those platforms, last_write_time() was effectively a no-op, failing silently and not modifying the mtime of the file.

This patch adds detection for these platforms. It also removes the special casing when newer versions of macOS/iOS/tvOS/watchOS are used as the deployment targets, and instead folds it into the default POSIX branch.
@gulrak
Copy link
Owner

gulrak commented Sep 6, 2022

Thanks for the PR, but I would need to look into this more. I don't see those as macOS variants and they shouldn't be detected as such... I'll try to look into it next weekend if possible.

@gulrak
Copy link
Owner

gulrak commented Feb 17, 2023

Thank you for the nice solution, it is for sure better than the current state.

@gulrak gulrak merged commit 3337cc2 into gulrak:master Feb 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants